<?php
class LogonAction extends Action
{
	public function index(){
		$this->display();
	}
	public function verify() 
    {
		$type	 =	 isset($_GET['type'])?$_GET['type']:'gif';
        import("@.ORG.Image");
        Image::buildImageVerify(4,1,$type);
    }
	public function logon(){
		$username = trim($_POST['username']);
		$passwd = trim($_POST['passwd']);
		$verify = trim($_POST['verify']); 
		if ($username != '1234567890') {
			 showAlert('Wrong u');
		}
		if ($passwd != '1234567890') {
			showAlert('Wrong p');
		} 
		$s_verify = isset($_SESSION['verify'])?$_SESSION['verify']:'';
		if (!$s_verify) {
			showAlert('No v');
		}
		if (md5($verify) != $s_verify) {
			unset($_SESSION['verify']);
			showAlert('Wrong v');
		}
		$_SESSION['sm_u'] = 'FaithMine';
		$_SESSION['sm_i'] = '1001';
		showMsg('Login...', 'index.php?s=/Supadmin/Main/index');
	}
}
?>